package com.chen.test;

import gen.R;
import gui.Activity;
import gui.framework.intent.Bundle;
import gui.view.Button;
import gui.view.View;
import gui.view.View.OnClickListener;

public class MainActivity extends Activity {
	private Button showButton, addButton, exportButton;

	public MainActivity() {
		setDebug(false);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_activity);
		setTitle("我的大脑");
		findView();
		addListener();
	}

	private void addListener() {
		showButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(ShowActivity.class);
				onFinish();
			}
		});
		addButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(AddActivity.class);
				onFinish();
			}
		});
		exportButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(ExportActivity.class);
				onFinish();
			}
		});
	}

	private void findView() {
		showButton = (Button) findViewById(R.id.show);
		addButton = (Button) findViewById(R.id.add);
		exportButton = (Button) findViewById(R.id.export);
	}
}
